 % Copyright (C) 2012 	Paul Bovbel, paul@bovbel.com
 % 						Richard Abrich, abrichr@gmail.com
 %
 % This file is part our empirical study of boosting algorithms (http://code.google.com/p/boosting-study/)
 % 
 % This is free software; you can redistribute it and/or modify
 % it under the terms of the GNU General Public License as published by
 % the Free Software Foundation; either version 3 of the License, or
 % (at your option) any later version.
 % 
 % This source code is distributed in the hope that it will be useful,
 % but WITHOUT ANY WARRANTY; without even the implied warranty of
 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 % GNU General Public License for more details.
 % 
 % You should have received a copy of the GNU General Public License
 % along with this source code. If not, see http://www.gnu.org/licenses/

function [ train_data ] = splitcont( train_data, num_intervals )

    F = size(train_data, 2);
    for i = 2 : F
        feature = train_data(:, i) + 1;
        if ~isequal(fix(feature), feature)
            % continuous
            interval = range(feature) / num_intervals;

            for k = 1 : num_intervals
                f(feature >= min(feature) + (k-1) * interval) = k;
            end 
            
            train_data(:,i) = f;
        end
    end 
end

